<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>16-box-sizing-练习</title>
    <style>
        .box {
            width: 300px;
            height: 100px;
            background-color: #0f0;
        }

        .child1, .child2 {
            width: 50%; /* 300px * 50% = 150px */
            height: 100%;
            display: inline-block;
            box-sizing: border-box;
        }

        .child1 {
            background-color: #f0f;
            border: 20px solid purple;
        }

        .child2 {
            background-color: #ff0;
            border: 5px solid blue;
        }
    </style>
</head>
<body>

<div class="box">
    <div class="child1"></div><div class="child2"></div>
</div>

</body>
</html>